package review;

public class ThreadTest01 {
    public static void main(String[] args) {
        //实现线程的第一种方式
        //写个类去继承Thread 然后new 一个线程对象
        Thread  t1 = new MyThread();
        System.out.println("test start");
        t1.start();
        for (int i = 0; i < 1000; i++) {
            System.out.println("main thread----->" + i);
        }


    }
}
//class extends Thread
class MyThread extends Thread{
    @Override
    public void run() {
        for (int i = 0; i < 1000; i++) {
            System.out.println("other thread----->" + i);
        }
    }
}
